<?php namespace Summer\Hjd\Models;

use Model;
use Config;

/**
 * Model
 */
class ChangeModel extends Model
{
    use \Winter\Storm\Database\Traits\Validation;
    

    /**
     * @var string The database table used by the model.
     */
    public $table = 'summer_hjd_change';

    /**
     * @var array Validation rules
     */
    public $rules = [
        'slug' => 'required|between:2,255|unique:summer_hjd_change',
        'title' => 'required|between:2,255',
    ];
    protected $fillable = [
        'slug',
        'title',
    ];
    public function getIncExpOptions()
    {
        return Config::get('summer.hjd::inc_exp');
    }

    /**
     * 财务流水筛选时的流水类型选项，因为用的是slug，但是keyFrom,Only supports integer values.
     * @return mixed
     */
    public function getFilterChangeSlugOptions()
    {
        return ChangeModel::lists('title', 'slug');
    }
}
